
function audioOndemand(audio,w,h,autoplay) {

//audio 	= audio.replace(/\//g, '%2F');
//spot 	= readCookie('spot');

//alert(spot);

if (typeof(spot)=='undefined' || spot===null) {
	spot="0";
}
spot 	= spot.replace(/\//g, '%2F');

//alert(spot);

player_o = '<object id="MediaPlayer" width="'+w+'" height="'+h+'" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"   codebase="http://activex.microsoft.com/activex/%20%20%20controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft� Windows� Media Player components..." type="application/x-oleobject" VIEWASTEXT>';

if (spot!='0') {
		player_o = player_o+ '<param name="FileName" value="http://cbn.globoradio.globo.com/playlist/asx.php?spot='+spot+'&audio='+audio+'">';
	} else {
		player_o = player_o+ '<param name="FileName" value="http://cbn.globoradio.globo.com/playlist/asx.php?audio='+audio+'">';
} 

//Define o autoplay
if(autoplay=='n'){
	player_o = player_o+'<param name="AutoStart" value="False">';
} else {
	player_o = player_o+'<param name="AutoStart" value="True">';
}
player_o = player_o+'<param name="TransparentAtStart" value="True">';
player_o = player_o+'<param name="ShowControls" value="True">';
player_o = player_o+'<param name="ShowDisplay" value="0">';
player_o = player_o+'<param name="ShowStatusBar" value="1">';
player_o = player_o+'<param name="AutoSize" value="0">';
player_o = player_o+'<param name="AnimationAtStart" value="true">';
player_o = player_o+'<!--NETSCAPE PLUG-IN STARTS HERE-->';
	if (spot!='0') {
		player_o = player_o+'<embed type="audio/x-ms-wma" id="MediaPlayer" width="'+w+'" height="'+h+'" src="http://cbn.globoradio.globo.com/playlist/asx.php?audio='+audio+'&spot='+spot+'" autostart="1" transparentatstart="1" showcontrols="1" showdisplay="0" showstatusbar="1" animationatstart="1">';
		player_o = player_o+'</embed>' ;
	} else {
		player_o = player_o+'<embed type="audio/x-ms-wma" id="MediaPlayer" width="'+w+'" height="'+h+'" src="http://cbn.globoradio.globo.com/playlist/asx.php?audio='+audio+'" autostart="1" transparentatstart="1" showcontrols="1" showdisplay="0" showstatusbar="1" animationatstart="1">';
		player_o = player_o+'</embed>' ;
	}
player_o = player_o+'</object>';

/// IE
player_ie =	'	<OBJECT id=MP1 codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 type=application/x-oleobject height='+h+' standby="Loading Microsoft Windows Media Player components..." width='+w+' classid=clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6>';

if (spot!='0') {
	player_ie = player_ie +  '<PARAM NAME = "URL" VALUE = "http://cbn.globoradio.globo.com/playlist/asx.php?spot='+spot+'&audio='+audio+'">';
		} else {
	player_ie = player_ie +  '<PARAM NAME = "URL" VALUE = "http://cbn.globoradio.globo.com/playlist/asx.php?audio='+audio+'">';
}

player_ie = player_ie +'    <PARAM NAME="rate" VALUE="1">';
player_ie = player_ie +'    <PARAM NAME="balance" VALUE="0">';
//player_ie = player_ie +'    <PARAM NAME="currentPosition" VALUE="1">';
//player_ie = player_ie +'    <PARAM NAME="defaultFrame" VALUE="">';
player_ie = player_ie +'    <PARAM NAME="playCount" VALUE="1">';
//Define o autoplay
if(autoplay=='n'){
	player_ie = player_ie +'    <PARAM NAME="autoStart" VALUE="0">';
} else {
	player_ie = player_ie +'    <PARAM NAME="autoStart" VALUE="-1">';	
}
//player_ie = player_ie +'    <PARAM NAME="currentMarker" VALUE="0">';
player_ie = player_ie +'    <PARAM NAME="invokeURLs" VALUE="-1">';
player_ie = player_ie +'    <PARAM NAME="baseURL" VALUE="">';
player_ie = player_ie +'    <PARAM NAME="volume" VALUE="50">';
player_ie = player_ie +'    <PARAM NAME="mute" VALUE="0">';
player_ie = player_ie +'    <PARAM NAME="uiMode" VALUE="full">';
player_ie = player_ie +'    <PARAM NAME="stretchToFit" VALUE="0">';
player_ie = player_ie +'    <PARAM NAME="windowlessVideo" VALUE="0">';
player_ie = player_ie +'    <PARAM NAME="enabled" VALUE="-1">';
player_ie = player_ie +'    <PARAM NAME="enableContextMenu" VALUE="-1">';
player_ie = player_ie +'    <PARAM NAME="fullScreen" VALUE="0">';
player_ie = player_ie +'    <PARAM NAME="SAMIStyle" VALUE="">';
player_ie = player_ie +'    <PARAM NAME="SAMILang" VALUE="">';
player_ie = player_ie +'    <PARAM NAME="SAMIFilename" VALUE="">';
player_ie = player_ie +'    <PARAM NAME="captioningID" VALUE="">';
player_ie = player_ie +'    <PARAM NAME="enableErrorDialogs" VALUE="0">';
player_ie = player_ie +'    <PARAM NAME="_cx" VALUE="4419">';
player_ie = player_ie +'    <PARAM NAME="_cy" VALUE="3069">';
    
if (spot!='0') {
		player_ie = player_ie +'    <embed pluginspage="http://www.microsoft.com/windows/windowsmedia/download/" src="http://cbn.globoradio.globo.com/playlist/asx.php?audio='+audio+'" width="'+w+'" height="'+h+'" autostart="1" controls="true" console="Clip1" type="application/x-mplayer2" filename="http://cbn.globoradio.globo.com/playlist/asx.php?spot='+spot+'&audio='+audio+'" showstatusbar="true" url="asx.php?spot='+spot+'&audio='+audio+'" showcontrols="true" uimode="full" rate="1" balance="0" currentposition="1" defaultframe="" playcount="1" currentmarker="0" invokeurls="-1" baseurl="" volume="50" mute="0" stretchtofit="0" windowlessvideo="0" enabled="-1" enablecontextmenu="-1" fullscreen="0" samistyle="" samilang="" samifilename="" captioningid="" enableerrordialogs="0" _cx="4419" _cy="3069">    </embed>';
} else {
		player_ie = player_ie + '   <embed pluginspage="http://www.microsoft.com/windows/windowsmedia/download/" src="http://cbn.globoradio.globo.com/playlist/asx.php?audio='+audio+'" width="'+w+'" height="'+h+'" autostart="1" controls="true" console="Clip1" type="application/x-mplayer2" filename="http://cbn.globoradio.globo.com/playlist/asx.php?audio='+audio+'" showstatusbar="1" url="http://cbn.globoradio.globo.com/playlist/asx.php?audio='+audio+'" showcontrols="true" uimode="mini" rate="1" balance="0" currentposition="0" defaultframe="" playcount="1" currentmarker="0" invokeurls="-1" baseurl="" volume="50" mute="0" stretchtofit="0" windowlessvideo="0" enabled="-1" enablecontextmenu="-1" fullscreen="0" samistyle="" samilang="" samifilename="" captioningid="" enableerrordialogs="0" _cx="4419" _cy="3069">    </embed>';
}   
   
    
player_ie = player_ie + '  </OBJECT>';


if (BrowserDetect.OS!='Windows' || BrowserDetect.browser=='Firefox' || BrowserDetect.browser=='Safari' || BrowserDetect.browser=='Opera') { 
	player_cod = player_o;
} else { 
	player_cod = player_ie;
}

//document.write(player_cod);
return player_cod;


}